From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 11:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 11:13:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0001.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0001.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0001.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0001.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0001.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0001.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0001.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 15:13:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0002.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0002.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0002.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0002.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0002.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0002.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0002.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0002.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 15:21:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0003.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0003.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0003.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0003.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0003.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0003.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0003.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0003.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0004.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0004.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0004.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0004.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:53 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0004.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0004.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0004.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0004.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 13 20:01:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0005.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0005.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0005.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0005.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0005.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0005.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0005.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0005.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 08:02:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:53 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0006.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0006.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0006.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0006.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0006.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0006.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0006.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0006.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 12:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0007.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0007.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0007.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0007.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0007.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0007.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0007.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0007.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 20:00:49 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0008.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0008.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0008.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0008.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0008.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0008.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0008.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0008.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 14 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M4-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0009.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0009.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0009.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0009.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0009.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0009.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0009.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0009.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 08:02:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0010.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0010.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0010.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0010.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0010.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0010.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0010.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0010.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 12:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0011.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0011.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 16:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0011.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0011.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0011.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0011.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0011.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0011.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 16:00:51 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0012.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0012.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0012.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0012.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0012.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0012.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0012.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0012.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 15 20:00:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:40 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0013.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0013.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0013.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0013.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0013.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0013.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0013.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0013.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 08:02:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0014.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0014.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0014.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 12:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0014.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0014.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0014.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0014.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0014.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 12:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0015.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0015.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0015.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0015.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:54 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0015.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0015.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0015.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0015.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 16:00:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0016.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0016.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0016.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0016.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0016.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0016.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0016.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0016.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 16 20:00:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0017.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0017.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0017.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0017.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0017.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0017.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0017.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0017.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 08:02:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0018.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0018.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0018.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0018.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0018.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0018.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0018.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 12:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0018.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M5-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0019.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0019.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0019.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0019.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0019.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0019.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0019.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0019.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 16:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:57 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0020.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0020.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0020.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0020.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0020.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0020.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0020.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0020.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 17 20:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0021.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0021.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0021.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0021.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0021.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0021.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0021.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0021.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 08:04:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0022.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0022.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0022.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0022.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0022.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0022.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0022.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0022.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 12:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:42 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0023.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0023.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0023.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0023.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0023.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0023.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0023.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0023.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 16:01:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0024.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0024.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0024.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0024.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0024.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0024.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0024.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0024.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 18 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0025.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0025.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0025.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0025.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0025.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0025.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0025.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0025.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 08:04:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0026.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0026.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0026.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0026.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0026.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0026.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0026.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0026.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 12:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0027.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0027.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 16:03:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0027.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0027.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 16:03:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0027.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0027.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 16:03:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0027.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 16:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0027.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 16:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 16:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0028.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0028.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0028.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0028.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 20:00:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0028.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0028.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0028.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0028.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 19 20:00:56 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M6-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0029.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0029.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0029.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0029.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0029.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0029.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0029.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0029.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 08:07:52 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0030.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0030.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0030.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 12:02:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0030.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0030.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 12:02:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0030.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0030.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0030.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0031.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0031.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0031.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0031.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 16:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0031.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0031.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0031.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0031.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 16:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0032.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0032.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0032.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0032.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0032.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0032.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0032.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0032.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 20 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 08:04:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0033.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0033.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 08:04:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0033.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0033.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0033.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0033.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0033.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0033.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 08:04:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0034.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0034.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0034.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0034.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 12:01:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0034.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0034.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0034.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0034.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 12:01:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0035.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0035.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0035.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0035.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0035.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0035.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0035.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0035.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 16:00:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0036.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0036.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0036.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0036.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0036.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0036.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0036.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0036.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 21 20:00:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0037.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0037.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0037.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0037.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 08:03:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0037.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:03:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 08:03:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0037.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0037.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0037.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 08:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0038.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0038.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0038.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0038.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0038.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0038.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0038.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0038.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 12:01:00 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:32 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:32 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M7-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0039.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0039.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0039.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0039.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 16:01:33 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0039.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0039.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0039.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0039.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 16:01:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0040.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0040.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0040.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0040.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0040.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 20:01:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0040.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0040.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0040.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 22 20:01:29 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 08:02:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0041.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0041.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 08:02:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0041.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0041.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0041.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0041.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0041.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0041.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 08:02:57 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0042.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0042.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0042.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0042.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 12:01:05 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0042.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0042.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0042.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0042.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 12:01:06 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0043.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0043.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0043.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0043.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 16:02:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0043.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0043.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0043.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0043.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 16:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0044.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0044.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0044.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0044.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0044.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0044.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0044.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0044.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 23 20:00:59 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0045.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0045.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0045.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0045.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0045.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0045.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0045.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0045.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 08:03:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 12:03:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0046.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0046.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0046.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0046.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 12:03:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0046.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 12:03:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0046.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 12:03:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0046.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 12:03:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0046.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 12:03:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 12:03:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:37 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0047.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0047.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0047.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0047.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0047.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 16:01:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0047.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0047.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0047.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 16:01:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0048.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0048.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0048.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0048.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0048.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0048.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0048.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0048.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 24 20:02:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M8-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0049.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0049.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0049.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0049.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0049.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0049.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0049.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0049.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 08:02:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0050.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0050.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0050.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0050.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0050.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0050.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0050.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0050.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 12:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0051.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0051.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 16:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0051.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0051.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0051.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0051.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0051.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0051.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 16:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0052.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0052.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0052.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0052.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0052.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0052.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0052.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0052.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Jan 25 20:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0053.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0053.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0053.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0053.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:28 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 08:06:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0053.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 08:06:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0053.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0053.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0053.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 08:06:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0054.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0054.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0054.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0054.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 12:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0054.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0054.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0054.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0054.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 12:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0055.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0055.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0055.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0055.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0055.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0055.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0055.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0055.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:53 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0056.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0056.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0056.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0056.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0056.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0056.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0056.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0056.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Jan 26 20:00:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 08:07:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0057.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0057.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 08:07:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0057.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0057.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:07:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 08:07:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0057.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0057.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0057.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0057.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 08:07:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 08:07:34 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 12:02:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0058.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0058.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0058.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0058.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0058.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0058.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0058.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0058.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 12:02:24 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M9-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0059.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0059.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0059.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0059.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0059.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0059.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0059.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 16:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0059.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:07 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:07 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0060.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0060.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0060.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0060.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0060.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0060.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0060.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0060.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Jan 27 20:01:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0061.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0061.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0061.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0061.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:06:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 08:06:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0061.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:06:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 08:06:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0061.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0061.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0061.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 08:06:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0062.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0062.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0062.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0062.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0062.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0062.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0062.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0062.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 12:02:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0063.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0063.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0063.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0063.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0063.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0063.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0063.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0063.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 16:01:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0064.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0064.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0064.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0064.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0064.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0064.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0064.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0064.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Jan 28 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0065.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0065.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0065.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0065.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:48 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0065.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0065.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0065.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0065.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 08:07:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0066.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0066.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0066.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0066.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:13 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0066.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0066.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0066.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0066.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 12:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0067.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0067.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0067.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0067.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0067.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:01:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0067.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0067.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0067.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 16:01:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0068.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0068.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0068.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0068.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0068.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0068.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0068.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0068.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Jan 29 20:01:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:09:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:55 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:09:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:09:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M:-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0069.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0069.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0069.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0069.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:10:01 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:10:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 08:10:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0069.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:10:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 08:10:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0069.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0069.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0069.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 08:10:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0070.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0070.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0070.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0070.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0070.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0070.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0070.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0070.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 12:04:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 16:04:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0071.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0071.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 16:04:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0071.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 16:04:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0071.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 16:04:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0071.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0071.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0071.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0071.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 16:04:33 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:27 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:27 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0072.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0072.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0072.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0072.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 20:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0072.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0072.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0072.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0072.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Jan 30 20:02:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0073.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0073.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0073.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0073.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 08:08:25 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:26 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 08:08:26 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 08:08:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 08:08:27 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0073.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0073.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0073.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0073.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:29 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 08:08:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:39 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:41 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0074.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0074.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0074.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0074.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 12:04:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0074.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 12:04:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0074.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 12:04:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0074.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 12:04:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0074.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 12:04:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 12:04:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0075.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0075.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0075.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0075.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 16:02:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0075.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0075.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0075.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0075.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 16:02:39 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0076.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0076.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0076.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0076.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0076.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0076.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0076.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0076.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Jan 31 20:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:31 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 08:10:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0077.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0077.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 08:10:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0077.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:35 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0077.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 08:10:37 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 08:10:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 08:10:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0077.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:45 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0077.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0077.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0077.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 08:10:49 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:57 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 12:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0078.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0078.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 12:02:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0078.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0078.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 12:03:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0078.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:03:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0078.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0078.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0078.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 12:03:01 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M;-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0079.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0079.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0079.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0079.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0079.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0079.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0079.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0079.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0080.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0080.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0080.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0080.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0080.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0080.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0080.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0080.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 1 20:01:14 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 08:14:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0081.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0081.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 08:14:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0081.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 08:14:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0081.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:14:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 08:14:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0081.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:14:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 08:14:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0081.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 08:14:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0081.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:14:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 08:14:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0081.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 08:14:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:14:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 08:14:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 12:03:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0082.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0082.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0082.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0082.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0082.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0082.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0082.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0082.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0083.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0083.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0083.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0083.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0083.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0083.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0083.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 16:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0083.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0084.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0084.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0084.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0084.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0084.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0084.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0084.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0084.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 2 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 08:13:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0085.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0085.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 08:13:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0085.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0085.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:27 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 08:13:28 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 08:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:13:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 08:13:35 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0085.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:13:35 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 08:13:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0085.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 08:13:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0085.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:13:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 08:13:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0085.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 08:13:43 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:13:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 08:13:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:02 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:02 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:02 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:02 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:02 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0086.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0086.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0086.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0086.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 12:03:03 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0086.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0086.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0086.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0086.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 12:03:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0087.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0087.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0087.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0087.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:14 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0087.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0087.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0087.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0087.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 16:01:16 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0088.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0088.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0088.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0088.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0088.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0088.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0088.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0088.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 3 20:01:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:46 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:47 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:47 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:48 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 08:08:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M<-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0089.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0089.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:50 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0089.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0089.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:51 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 08:08:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:52 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:52 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 08:08:53 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:53 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 08:08:53 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 08:08:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 08:09:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0089.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:09:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 08:09:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0089.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 08:09:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0089.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:09:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 08:09:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0089.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 08:09:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:09:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 08:09:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0090.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0090.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0090.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0090.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0090.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 12:03:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0090.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 12:03:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0090.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:03:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 12:03:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0090.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 12:03:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:03:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 12:03:08 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0091.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0091.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0091.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0091.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0091.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 16:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0091.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0091.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0091.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0092.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0092.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0092.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0092.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0092.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0092.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0092.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0092.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 4 20:01:15 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:13 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:13 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:13 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0093.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0093.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0093.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0093.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 08:08:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0093.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0093.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0093.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0093.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 08:08:18 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0094.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0094.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0094.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0094.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 12:03:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0094.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:03:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0094.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0094.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0094.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 12:03:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0095.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0095.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0095.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0095.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0095.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 16:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0095.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0095.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0095.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 16:01:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0096.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0096.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0096.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0096.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:08 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0096.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0096.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0096.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0096.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 5 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:27 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:28 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 08:16:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0097.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0097.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 08:16:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0097.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0097.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:37 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 08:16:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 08:16:39 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 08:16:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:16:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 08:16:48 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0097.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:16:48 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 08:16:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0097.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 08:16:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0097.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:16:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 08:16:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0097.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 08:16:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 08:16:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:05 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:05 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:06 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 12:03:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0098.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0098.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 12:03:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0098.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:07 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0098.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:03:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0098.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0098.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0098.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0098.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 12:03:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(M=-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0099.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0099.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0099.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0099.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0099.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0099.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0099.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0099.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0100.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0100.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0100.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0100.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0100.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0100.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0100.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0100.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 6 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:01 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:01 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:02 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 08:26:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0101.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0101.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 08:26:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0101.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 08:26:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0101.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:15 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:26:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 08:26:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:26:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 08:26:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0101.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:26:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 08:26:39 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0101.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 08:26:40 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0101.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:26:40 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 08:26:40 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0101.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 08:26:40 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:26:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 08:26:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0102.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0102.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0102.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0102.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 12:03:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0102.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0102.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0102.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0102.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 12:03:44 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0103.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0103.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0103.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0103.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0103.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0103.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0103.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0103.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 16:01:26 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0104.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0104.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0104.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0104.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 20:01:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0104.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0104.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0104.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0104.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 7 20:01:19 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:24:49 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:24:50 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:24:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:24:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:24:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:24:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:24:51 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 08:25:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0105.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0105.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 08:25:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0105.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:17 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 08:25:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0105.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:25:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:25:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:25:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:25:19 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 08:25:20 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:20 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:20 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 08:25:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 08:25:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 08:25:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:25:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 08:25:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0105.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:25:26 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 08:25:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0105.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 08:25:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0105.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:25:42 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 08:25:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0105.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 08:25:43 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:25:43 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 08:25:43 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:51 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:51 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:52 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0106.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0106.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0106.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0106.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:54 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 12:03:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0106.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 12:03:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0106.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 12:03:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0106.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:57 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 12:03:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0106.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 12:03:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 12:03:58 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0107.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0107.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0107.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0107.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0107.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0107.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0107.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0107.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 16:01:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:15 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0108.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0108.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0108.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0108.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 20:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0108.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0108.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0108.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0108.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 8 20:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:14 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 08:10:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mt-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0109.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0109.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0109.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0109.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:10:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 08:10:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0109.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:10:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0109.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0109.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0109.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 08:10:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:33 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:33 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:33 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:34 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:34 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:34 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:34 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 12:03:35 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0110.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0110.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:35 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0110.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0110.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 12:03:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0110.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:38 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 12:03:40 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0110.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 12:03:40 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0110.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 12:03:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0110.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 12:03:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 12:03:41 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:29 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0111.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0111.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0111.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0111.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0111.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0111.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0111.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0111.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 16:01:30 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0112.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0112.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0112.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0112.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0112.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 20:01:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0112.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0112.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0112.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 9 20:01:25 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:09 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:09 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 08:23:34 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0113.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0113.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 08:23:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0113.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 08:23:40 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0113.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:40 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:23:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 08:23:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:43 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:44 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 08:23:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:23:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 08:23:44 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 08:23:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:23:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 08:24:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0113.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:24:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 08:24:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0113.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 08:24:27 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0113.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:24:27 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 08:24:31 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0113.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 08:24:31 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:24:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 08:24:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:56 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0114.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0114.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0114.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0114.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 12:04:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0114.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:04:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0114.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0114.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0114.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 12:04:02 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:21 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0115.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0115.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0115.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0115.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0115.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0115.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0115.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0115.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0116.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0116.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0116.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0116.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Feb 10 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0116.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0116.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0116.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0116.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Feb 10 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 08:13:38 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0117.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0117.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:39 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 08:13:39 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0117.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:39 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 08:13:40 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0117.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:40 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:40 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:40 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 08:13:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0117.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:44 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 08:13:46 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0117.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 08:13:46 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0117.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 08:13:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0117.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 08:13:47 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:47 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 08:13:47 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:59 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:00 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0118.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0118.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0118.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0118.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:03:02 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0118.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:03:04 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0118.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0118.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 12:03:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0118.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 12:03:05 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:03:06 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 12:03:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mu-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0119.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0119.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0119.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0119.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0119.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 16:01:16 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0119.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0119.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0119.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 16:01:17 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0120.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0120.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0120.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0120.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0120.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 20:01:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0120.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0120.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0120.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sat Feb 11 20:01:10 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:15 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:17 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 08:10:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0121.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0121.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:20 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 08:10:20 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0121.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:20 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0121.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:10:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 08:10:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0121.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:10:24 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 08:10:27 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0121.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 08:10:27 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0121.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:10:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 08:10:28 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0121.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 08:10:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:10:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 08:10:28 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:06 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:06 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:07 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:07 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 12:03:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0122.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0122.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 12:03:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0122.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 12:03:08 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0122.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:03:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0122.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:03:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0122.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0122.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0122.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 12:03:12 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0123.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0123.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0123.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0123.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0123.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0123.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0123.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0123.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 16:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:11 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0124.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0124.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0124.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0124.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:12 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0124.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0124.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0124.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0124.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Sun Feb 12 20:01:13 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:23 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 08:18:31 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0125.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0125.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:32 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 08:18:32 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0125.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:32 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 08:18:37 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0125.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:38 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 08:18:39 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 08:18:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:18:41 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 08:18:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0125.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:18:43 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 08:18:52 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0125.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 08:18:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0125.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:18:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 08:18:53 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0125.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 08:18:53 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:18:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 08:18:54 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:25 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 12:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0126.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0126.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 12:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0126.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:28 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0126.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:29 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 12:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0126.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:30 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0126.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0126.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0126.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 12:03:32 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0127.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0127.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0127.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0127.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0127.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0127.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0127.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0127.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 16:01:37 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:19 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0128.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0128.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0128.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0128.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0128.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0128.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 20:01:21 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0128.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Mon Feb 13 20:01:22 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0128.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 20:01:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Mon Feb 13 20:01:22 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:45 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:46 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:46 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:46 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:46 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:47 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 08:20:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mv-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0129.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0129.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 08:20:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0129.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 08:20:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0129.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:20:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:20:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 08:21:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0129.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:21:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 08:21:10 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0129.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0129.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0129.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 08:21:11 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:41 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:41 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:43 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:43 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 12:03:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0130.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0130.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 12:03:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0130.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0130.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:45 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 12:03:46 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 12:03:46 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:46 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 12:03:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0130.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0130.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0130.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0130.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 12:03:50 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0131.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0131.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0131.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0131.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0131.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0131.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0131.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0131.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 16:01:55 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0132.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0132.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0132.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0132.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:22 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0132.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0132.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0132.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0132.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Tue Feb 14 20:01:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:25 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:25 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:26 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 08:31:40 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0133.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0133.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:40 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 08:31:43 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0133.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 08:31:47 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0133.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:48 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 08:31:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:31:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 08:31:50 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 08:31:50 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:31:51 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 08:32:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0133.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:32:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 08:32:18 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0133.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 08:32:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0133.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:32:19 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 08:32:20 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0133.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 08:32:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:32:20 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 08:32:21 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:54 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:54 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:55 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 12:05:56 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0134.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0134.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 12:05:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0134.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 12:05:57 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0134.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:57 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 12:05:58 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:59 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 12:06:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0134.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:06:01 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 12:06:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0134.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 12:06:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0134.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:06:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 12:06:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0134.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 12:06:03 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:06:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 12:06:04 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0135.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0135.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0135.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:44 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0135.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 16:01:45 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0135.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0135.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0135.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0135.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:47 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 16:01:48 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:22 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0136.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0136.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0136.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0136.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0136.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0136.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0136.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0136.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 19:28:23 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:48 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:49 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 20:14:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0137.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0137.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 20:14:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0137.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Wed Feb 15 20:14:55 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0137.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:55 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:56 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 20:15:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0137.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:15:00 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 20:15:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0137.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 20:15:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0137.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:15:08 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Wed Feb 15 20:15:09 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0137.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 20:15:09 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:15:09 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Wed Feb 15 20:15:09 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:36 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:48:38 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:38 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:48:38 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:48:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:39 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 16 08:48:52 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0138.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0138.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:53 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 16 08:48:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0138.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:48:54 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Thu Feb 16 08:49:01 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0138.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:49:02 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:49:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:49:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:49:04 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Thu Feb 16 08:49:05 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:49:06 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:49:06 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 16 08:49:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:49:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Thu Feb 16 08:49:06 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 16 08:49:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:49:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 16 08:49:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0138.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:49:25 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 16 08:49:34 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0138.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 16 08:49:35 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0138.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:49:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Thu Feb 16 08:49:36 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0138.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 16 08:49:36 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:49:37 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Thu Feb 16 08:49:37 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Tue Feb 1 08:55:06 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FF35DA.9090406@egenix.com> Bob Gibson wrote: > > > > Hi: > > I'm working with mxODBC, and have successfully connected to my database. > This is the good news. :-) > > When I try to "set schema" though, I get a -1 return value. What, > exactly, does this mean? What am I doing wrong? Nothing. The -1 return value is from the old days when .execute() used to return the number of affected rows (or -1 in case the statement did not affect any). With DB-API 2.0 you should always use .rowcount instead. > ---------------------------------------------------------------------- > C:\Programs\Python\Python2Derby>python > ActivePython 2.4 Build 243 (ActiveState Corp.) based on > Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC as ODBC >>>>DB = ODBC.Windows >>>>db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm' > > ) > >>>>cursor = db.cursor() >>>>cursor.execute( "select count(*) from sys.systables" ) >>>>for field in cursor.description : > > ... print field > ... > ('1', 4, None, None, 10, 0, 0) > >>>>data = cursor.fetchall() >>>>for row in data : > > ... print row > ... > (58,) > >>>>cursor.execute( "set schema school" ) > > -1 > > ---------------------------------------------------------------------- > > By the way, I know that the schema name is correct. I created the > database, the tables, and all the schema names. > > Here's a sample DB2CLP session that shows the same command executing > successfully. > > ---------------------------------------------------------------------- > db2 => connect to sq4mm user Ima using Lumberjack > > Database Connection Information > > Database server = Apache Derby CSS10000 > SQL authorization ID = IMA > Local database alias = SQ4MM > > db2 => select count(*) from sys.systables > > 1 > ----------- > 58 > > 1 record(s) selected. > > db2 => set schema school > DB20000I The SQL command completed successfully. > db2 => > ---------------------------------------------------------------------- > > > Thanks in advance > Bob > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > ------------------------------------------------------------------------ > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 10:04:05 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 Message-ID: <41FF4605.3040102@redcor.ch> Trying to build mxOdbc on a suse 9.1 box I get the following errors. Googling for an explanation I found a hint that iodbc is not supported on SuSe >= 9.0 anymore. What should I do ?? thanks Robert izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build running build running mx_autoconf gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o running build_ext building 'mx.ODBC.iODBC.mxODBC' extension gcc -pthread -shared build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: cannot find -liodbc collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 From mal at egenix.com Tue Feb 1 10:15:37 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] mxOdbc on suse 9.1 In-Reply-To: <41FF4605.3040102@redcor.ch> References: <41FF4605.3040102@redcor.ch> Message-ID: <41FF48B9.6020902@egenix.com> robert wrote: > Trying to build mxOdbc on a suse 9.1 box I get the following errors. > Googling for an explanation I found a hint that iodbc is not supported > on SuSe >= 9.0 anymore. Weird - iODBC certainly compiles on SuSE 9.0+. In any case we do support iODBC as well as unixODBC. > What should I do ?? I'd suggest that you edit the mxCOMMERCIAL.py file and comment out the section for iODBC. You will then have to use unixODBC to talk to your databases. > thanks > Robert > > izar:/home/download/egenix-mx-commercial-2.0.7 # ./setup.py build > running build > running mx_autoconf > gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fno-strict-aliasing -fPIC -D_GNU_SOURCE=1 -I/usr/include/python2.3 > -I/usr/local/include -I/usr/include -c _configtest.c -o _configtest.o > success! > removing: _configtest.c _configtest.o > running build_ext > building 'mx.ODBC.iODBC.mxODBC' extension > gcc -pthread -shared > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxODBC.o > build/temp.linux-i686-2.3/mx/ODBC/iODBC/mxODBC/mx/ODBC/iODBC/mxSQLCodes.o > -L/usr/local/iODBC/lib -L/usr/local/lib -L/usr/lib -liodbc -o > build/lib.linux-i686-2.3/mx/ODBC/iODBC/mxODBC.so > /usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../../i586-suse-linux/bin/ld: > cannot find -liodbc > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 11:42:08 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope Message-ID: <41FF5D00.6020503@redcor.ch> Hi there, we have a mxODBC adapter installed for Zope. To do so I had to copy a couple of directories, one of which has the licence info. Now I compiled the newest mxCOMERCIAL (and the base and experimental) package. What do I have to do, to make Zope to use the new package. Just delete the mx directory in ZOPE/lib/python ?? thanks Robert From mal at egenix.com Tue Feb 1 12:11:23 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF5D00.6020503@redcor.ch> References: <41FF5D00.6020503@redcor.ch> Message-ID: <41FF63DB.5060900@egenix.com> robert wrote: > Hi there, > we have a mxODBC adapter installed for Zope. > To do so I had to copy a couple of directories, one of which has the > licence info. > Now I compiled the newest mxCOMERCIAL (and the base and experimental) > package. > > What do I have to do, to make Zope to use the new package. > Just delete the mx directory in ZOPE/lib/python ?? No. The versions of mxODBC in egenix-mx-commercial and the ones that come with the Zope DA are different. The Zope DA has the 2.1.x versions of egenix-mx-commercial and egenix-mx-base, which are not yet available as stand-alone versions. It won't work with the current egenix-mx-commercial stand-alone version (which is 2.0.x). So, to answer your subject line: you shouldn't mix the two. The mxODBC Zope DA comes with everything you need and in fact with more recent versions of the software than available otherwise. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 robert at redcor.ch Tue Feb 1 12:55:36 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF63DB.5060900@egenix.com> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> Message-ID: <41FF6E38.3000205@redcor.ch> M.-A. Lemburg wrote: > robert wrote: > >> Hi there, >> we have a mxODBC adapter installed for Zope. >> To do so I had to copy a couple of directories, one of which has the >> licence info. >> Now I compiled the newest mxCOMERCIAL (and the base and experimental) >> package. >> >> What do I have to do, to make Zope to use the new package. >> Just delete the mx directory in ZOPE/lib/python ?? > > > No. > > The versions of mxODBC in egenix-mx-commercial and the > ones that come with the Zope DA are different. > > The Zope DA has the 2.1.x versions of egenix-mx-commercial and > egenix-mx-base, which are not yet available as stand-alone > versions. It won't work with the current egenix-mx-commercial > stand-alone version (which is 2.0.x). > > So, to answer your subject line: you shouldn't mix the two. > The mxODBC Zope DA comes with everything you need and in fact > with more recent versions of the software than available > otherwise. > thanks, so I downloaded: http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip do I just copy its directory structure to the Zope folder. Would this kill my licenses? Robert From mal at egenix.com Tue Feb 1 13:13:25 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:58 2006 Subject: [egenix-users] how to mix mxCOMERCIAL and mxODBC for Zope In-Reply-To: <41FF6E38.3000205@redcor.ch> References: <41FF5D00.6020503@redcor.ch> <41FF63DB.5060900@egenix.com> <41FF6E38.3000205@redcor.ch> Message-ID: <41FF7265.9050904@egenix.com> robert wrote: >> So, to answer your subject line: you shouldn't mix the two. >> The mxODBC Zope DA comes with everything you need and in fact >> with more recent versions of the software than available >> otherwise. >> > thanks, so I downloaded: > http://www.egenix.com/files/python/egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip > > do I just copy its directory structure to the Zope folder. > Would this kill my licenses? The license files are valid for all mxODBC Zope DA versions 1.0.x (including the 1.0.9 pre-release). You only need new licenses in case you plan to upgrade to a new minor or major version release (e.g. 1.0.x -> 1.1.x or 1.0.x -> 2.0.x). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 10:36:06 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Mar 31 16:34:00 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FF35DA.9090406@egenix.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- z'mjZr+t֦z %'ʗJ,׍׬ Zi^Rڭb?zz?jZr?M9m5:yo+k'(Mw-------------- next part -------------- A non-text attachment was scrubbed... Name: pic09813.gif Type: image/gif Size: 1699 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/pic09813-0139.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: ecblank.gif Type: image/gif Size: 61 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20050201/686ee78b/ecblank-0139.gif From mal at egenix.com Tue Feb 1 17:03:00 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:00 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFA834.5030503@egenix.com> Bob Gibson wrote: > > > > > Marc: > > Ah, so it worked? This I have to test. :-) > > So I wrote a test script to use this information. The output is below. > Since rowcount is always -1, it would seem that this information isn't > available from the interface. That is possible since not all data sources are able to report the correct size of the result size. Like in your case, there are also a few types of data sources that don't even know how to count ;-) (given that .fetchall() provides this information). What kind of backend database and ODBC driver are you using ? > Things are looking up! Thanks (yet again). > > -------------------------------------------------------------------------------- > C:\Programs\Python> dotest > set schema bowling > cursor.rowcount after query: "select * from teams" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (1, 'Marlins', 2) > (2, 'Sharks', 5) > (3, 'Terrapins', 12) > (4, 'Barracudas', 16) > (5, 'Dolphins', 20) > (6, 'Orcas', 24) > (7, 'Manatees', 28) > (8, 'Swordfish', 32) > > set schema school > cursor.rowcount after query: "select * from faculty" = -1 > cursor.rowcount after fetchall(): -1 > Query result: > (98005, 'Instructor', 'Full Time', 1) > (98007, 'Associate Professor', 'Full Time', 1) > (98010, 'Associate Professor', 'On Leave', 1) > (98011, 'Instructor', 'Full Time', 1) > (98012, 'Instructor', 'Full Time', 1) > (98013, 'Instructor', 'Full Time', 1) > (98014, 'Professor', 'Full Time', 1) > (98019, 'Instructor', 'Full Time', 1) > (98020, 'Instructor', 'Full Time', 1) > (98025, 'Associate Professor', 'Full Time', 1) > (98028, 'Professor', 'Full Time', 1) > (98030, 'Instructor', 'Full Time', 1) > (98036, 'Professor', 'Full Time', 1) > (98040, 'Associate Professor', 'Full Time', 1) > (98042, 'Associate Professor', 'Full Time', 1) > (98045, 'Professor', 'Full Time', 1) > (98048, 'Professor', 'Full Time', 1) > (98052, 'Instructor', 'Part Time', 0) > (98053, 'Instructor', 'Full Time', 1) > (98055, 'Professor', 'Full Time', 1) > (98059, 'Instructor', 'Full Time', 1) > (98062, 'Associate Professor', 'Full Time', 0) > (98063, 'Instructor', 'Full Time', 1) > (98064, 'Professor', 'Full Time', 1) > > -------------------------------------------------------------------------------- > > > Bob > > > Ps 37:16 It is better to be godly and have little than to be evil and > possess much. > > > > > "M.-A. Lemburg" > > To > 02/01/2005 02:55 Bob Gibson/Raleigh/IBM@IBMUS > AM cc > egenix-users@lists.egenix.com > Subject > Re: [egenix-users] mxODBC - How do > I "set schema"? > > > > > > > > > > > Bob Gibson wrote: > >> >> >>Hi: >> >> I'm working with mxODBC, and have successfully connected to my > > database. > >>This is the good news. :-) >> >> When I try to "set schema" though, I get a -1 return value. What, >>exactly, does this mean? What am I doing wrong? > > > Nothing. The -1 return value is from the old days when .execute() > used to return the number of affected rows (or -1 in case the > statement did not affect any). > > With DB-API 2.0 you should always use .rowcount instead. > > <<< Text removed for brevity >>> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Feb 01 2005) > >>> 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 ! :::: > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 28 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 13:01:46 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Mar 31 16:34:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFA834.5030503@egenix.com> Message-ID: Marc: > What kind of backend database and ODBC driver are you using ? Database: Cloudscape: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html Derby : http://incubator.apache.org/derby ODBC Driver: DB2 ODBC Driver: http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Thanks again for your help and software. Bob Ps 37:16 It is better to be godly and have little than to be evil and possess much.-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/9ef5079f/attachment-0139.htm From mal at egenix.com Tue Feb 1 19:48:31 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:02 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: References: Message-ID: <41FFCEFF.9010807@egenix.com> Bob Gibson wrote: >>What kind of backend database and ODBC driver are you using ? > > > Database: > Cloudscape: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0408cline/index.html > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: > http://www.ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 01 2005) >>> 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 bgibson at us.ibm.com Tue Feb 1 14:16:49 2005 From: bgibson at us.ibm.com (Bob Gibson) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] mxODBC - How do I "set schema"? In-Reply-To: <41FFCEFF.9010807@egenix.com> Message-ID: Bob Gibson wrote: > > Database: > Cloudscape: << URL removed >> > Derby : http://incubator.apache.org/derby > > ODBC Driver: > DB2 ODBC Driver: << URL removed >> > Interesting, so Derby (Cloudscape) and DB2 talk the same wire protocol ? Perhaps you could ask the developers whether the missing rowcount information is per design or simply a bug in the ODBC driver ?! Such information is usually rather important to have, esp. in cases where you want to page through large data sets. Thanks, -- Marc-Andre Lemburg ---------------------------------------------------------------------- Well, I can certainly try. Here is some articles from developerWorks Title: Cloudscape and ODBC http://ibm.com/developerworks/db2/library/techarticle/dm-0409cline2/index.html Title: ODBC programming using Apache Derby http://ibm.com/developerworks/db2/library/techarticle/dm-0409kartha/index.html Thanks, yet again Bob-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050201/b55befde/attachment-0139.htm From robert at redcor.ch Wed Feb 2 08:33:52 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update Message-ID: <42008260.3040609@redcor.ch> Hi there, after updating to the newest version of the mxODBC adapter the Zope egenix-Objects show as broken. Trying to do a refresh of *mxODBCZopeDA *I get the following error: Thanks for any help, (the users are screaming) Robert *An exception occurred during the last refresh.* Exception type: *AttributeError* Exception value: *'module' object has no attribute '__version__'* Traceback (most recent call last): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 182, in performSafeRefresh if not performRefresh(jar, productid): File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line 169, in performRefresh Application.reimport_product(productid) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 863, in reimport_product raise_exc=1, log_exc=0) File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line 660, in import_product product=__import__(pname, global_dict, global_dict, silly) File "Products/mxODBCZopeDA/__init__.py", line 7, in ? # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? AttributeError: 'module' object has no attribute '__version__' From robert at redcor.ch Wed Feb 2 08:39:44 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008260.3040609@redcor.ch> References: <42008260.3040609@redcor.ch> Message-ID: <420083C0.30500@redcor.ch> Some more info: What I did is: I did install mx_commercial I did copy the lib directory that came with the distribution to my Zope installation. Robert robert wrote: > Hi there, > after updating to the newest version of the mxODBC adapter > the Zope egenix-Objects show as broken. > Trying to do a refresh of *mxODBCZopeDA > > *I get the following error: > > Thanks for any help, (the users are screaming) > > Robert > > *An exception occurred during the last refresh.* > Exception type: *AttributeError* > Exception value: *'module' object has no attribute '__version__'* > > Traceback (most recent call last): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 182, in performSafeRefresh > if not performRefresh(jar, productid): > File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line > 169, in performRefresh > Application.reimport_product(productid) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 863, in reimport_product > raise_exc=1, log_exc=0) > File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line > 660, in import_product > product=__import__(pname, global_dict, global_dict, silly) > File "Products/mxODBCZopeDA/__init__.py", line 7, in ? > # Version 2.0 (ZPL). A copy of the ZPL should accompany this > distribution. > File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? > AttributeError: 'module' object has no attribute '__version__' > > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users > From robert at redcor.ch Wed Feb 2 08:51:44 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420083C0.30500@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> Message-ID: <42008690.4090009@redcor.ch> Starting Zope with runzope I get the following: ope@izar:~> instances/fha1.5/bin/runzope *** Problem importing the eGenix mx Extensions: Please make sure that you have downloaded and installed the right eGenix mxODBC Zope DA version for your version of Zope. Zope comes with its own built-in Python interpreter and binaries for different versions of the interpreter are mutually incompatible. Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) [GCC 3.3.3 (SuSE Linux)] the version I unpacked is: egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert robert wrote: > Some more info: > What I did is: > I did install mx_commercial > I did copy the lib directory that came with the distribution to my > Zope installation. > > Robert > > robert wrote: > >> Hi there, >> after updating to the newest version of the mxODBC adapter >> the Zope egenix-Objects show as broken. >> Trying to do a refresh of *mxODBCZopeDA >> >> *I get the following error: >> >> Thanks for any help, (the users are screaming) >> >> Robert >> >> *An exception occurred during the last refresh.* >> Exception type: *AttributeError* >> Exception value: *'module' object has no attribute '__version__'* >> >> Traceback (most recent call last): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 182, in performSafeRefresh >> if not performRefresh(jar, productid): >> File "/home/zope/Zope-2.7.3-0/lib/python/App/RefreshFuncs.py", line >> 169, in performRefresh >> Application.reimport_product(productid) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 863, in reimport_product >> raise_exc=1, log_exc=0) >> File "/home/zope/Zope-2.7.3-0/lib/python/OFS/Application.py", line >> 660, in import_product >> product=__import__(pname, global_dict, global_dict, silly) >> File "Products/mxODBCZopeDA/__init__.py", line 7, in ? >> # Version 2.0 (ZPL). A copy of the ZPL should accompany this >> distribution. >> File "Products/mxODBCZopeDA/ZopeDA.py", line 463, in ? >> AttributeError: 'module' object has no attribute '__version__' >> >> >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users >> > > From charlie at egenix.com Wed Feb 2 10:10:14 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <42008690.4090009@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <42008690.4090009@redcor.ch> Message-ID: <20050202101014.2724.7@Zeta.1107334247.fake> On 2005-02-02 at 08:51:44 [+0100], robert wrote: > Starting Zope with runzope I get the following: > ope@izar:~> instances/fha1.5/bin/runzope > *** Problem importing the eGenix mx Extensions: > > Please make sure that you have downloaded and installed > the right eGenix mxODBC Zope DA version for your version > of Zope. Zope comes with its own built-in Python interpreter > and binaries for different versions of the interpreter are > mutually incompatible. > > Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) > [GCC 3.3.3 (SuSE Linux)] > > the version I unpacked is: > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip Robert, you do not need to a separate install of mxCommercial as the mxODBCZopeDA contains the latest version of mxCommercial which is not availably separately. You cannot mix and match. From the error message it looks as if you have incorrectly installed things. Please check that you install mxODBCZopeDA to the Products folder of the Zope installation and not the specific Zope instance and that the mx libraries are in the appropriate path for your Python version. Hope this helps Charlie Clark -- 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,Linux,Solaris,FreeBSD for free ! :::: From robert at redcor.ch Thu Feb 3 15:39:48 2005 From: robert at redcor.ch (robert) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <20050202101014.2724.7@Zeta.1107334247.fake> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <20050202101014.2724.7@Zeta.1107334247.fake> Message-ID: <420237B4.1010801@redcor.ch> Charlie Clark wrote: >On 2005-02-02 at 08:51:44 [+0100], robert wrote: > > >>Starting Zope with runzope I get the following: >>ope@izar:~> instances/fha1.5/bin/runzope >>*** Problem importing the eGenix mx Extensions: >> >>Please make sure that you have downloaded and installed >>the right eGenix mxODBC Zope DA version for your version >>of Zope. Zope comes with its own built-in Python interpreter >>and binaries for different versions of the interpreter are >>mutually incompatible. >> >>Your Zope installation is using: Python 2.3.4 (#1, Jul 9 2004, 22:18:51) >>[GCC 3.3.3 (SuSE Linux)] >> >>the version I unpacked is: >>egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip >> >> > >Robert, > >you do not need to a separate install of mxCommercial as the mxODBCZopeDA >contains the latest version of mxCommercial which is not availably >separately. You cannot mix and match. From the error message it looks as if >you have incorrectly installed things. Please check that you install >mxODBCZopeDA to the Products folder of the Zope installation and not the >specific Zope instance and that the mx libraries are in the appropriate >path for your Python version. > >Hope this helps > >Charlie Clark > > Thanks Charlie, I "fixed" things by copying the old ZOPE/lib/python/mx folder (old meaning the one bevor I installed the egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the "new" mxODBCZopeDA with the "old" mx libraries. I rather have both the same version. Somehow I have the fealing this is a licence issue??? Robert From mal at egenix.com Thu Feb 3 16:24:29 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Help! Zope adapter stoped working after update In-Reply-To: <420237B4.1010801@redcor.ch> References: <42008260.3040609@redcor.ch> <420083C0.30500@redcor.ch> <420237B4.1010801@redcor.ch> Message-ID: <4202422D.5090202@egenix.com> robert wrote: > I "fixed" things by copying the old ZOPE/lib/python/mx folder (old > meaning the one bevor I installed the > egenix-mxodbc-zopeda-1.0.9.linux-i686-py2.3ucs4.zip). I have now the > "new" mxODBCZopeDA with the "old" mx libraries. > > I rather have both the same version. > > Somehow I have the fealing this is a licence issue??? If it were, you'd get a different error message, one that suggest that there is a license problem. In your case, the Zope DA simply can't find the eGenix mx tools which suggests that you have them installed in the wrong directory or that your Zope is running a different Python version that is not compatible with the binaries it finds. I'd suggest to do a complete reset, remove the Zope DA installation and then reinstall it according to the instructions given in the documentation: 1. remove any lib/python/mx directories you have in the Zope software directory (the one where the Zope core code lives) and any of the Zope instance directories (where the Zope instance code lives) 2. remove the Products/mxODBCZopeDA directories in the same manner Then, unzip the product archive in the Zope software directory (*not* the instance directory) and reinstall the license files as outlined in the email they came with. If you don't like having products in the Zope software directory, you can also move the directory lib/python/Products to the Zope instance directory and the lib/python/mx directory to the instance's lib/python directory. You cannot just unzip the product archive in the instance directory, because Zope will then not find the product software. It is unfortunate that the Zope Corp changed the layout in an incompatible way between 2.6 and 2.7, so I guess we'll have to start providing two different downloads starting with the next versions of the mxODBC Zope DA. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 03 2005) >>> 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 Feb 7 18:41:54 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Re: [egenix-support] Per-user connection (was: Over Connection pool) In-Reply-To: References: Message-ID: <4207A862.401@egenix.com> Palomino Campos Juber wrote: > We are developing a integrated system with Zope, and we need that all system users could make a connection to the database with their own "user" and "password", in design we use a object connection "Z Oracle Database Connection" but it works just with one user (hard code), We don't know how to make a dynamic one in which i could send parameters "user" and "password". > This is important to implement the security system by database roles. If you only want authentication checking against the database, I'd suggest you implement this using an External Method which then tries to connect to the database using the given uid and passwd: import mx.ODBC.Windows as ODBC def database_authentication_check(uid, passwd): try: db = ODBC.Connect('datasourcename', uid, passwd) except ODBC.Error: return 0 else: db.close() return 1 Creating an mxODBC Zope DA connection object per user (temporary or stored in the ZODB as connect-on-demand) would be another possibility. OTOH, manipulating the attributes of a single existing connection object is a bad idea since every change would result in a new revision of the connection object. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 07 2005) >>> 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 maneeshsingh at yahoo.com Tue Feb 8 08:26:48 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Hi, I need to aceess a view on a MS SQL Server 2000 database from my Fedora Core 2 machine using freetds+unixODBC+mxODBC (Python 2.3). The SQL query runs fine with isql but gives the following error with a python script: ---------------------------- mxODBC.ProgrammingError: ('S0002', 208, "[unixODBC][FreeTDS][SQL Server]Invalid object name 'viewExEmployeeDetails'.", 4612) ---------------------------- The sql query fired is: ---------------------------- SELECT * FROM viewExEmployeeDetails WHERE ProjectTilte='MIS' ORDER BY Name ASC ---------------------------- Does anyone have a reason/solution to this problem? Can access views through mxODBC? Thanks! Maneesh Singh. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From mal at egenix.com Wed Feb 9 10:50:03 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. In-Reply-To: <20050208162648.32891.qmail@web14207.mail.yahoo.com> References: <20050208162648.32891.qmail@web14207.mail.yahoo.com> Message-ID: <4209DCCB.80108@egenix.com> Maneesh Singh wrote: > Hi, > I need to aceess a view on a MS SQL Server 2000 > database from my Fedora Core 2 machine using > freetds+unixODBC+mxODBC (Python 2.3). > The SQL query runs fine with isql but gives the > following error with a python script: > ---------------------------- > mxODBC.ProgrammingError: ('S0002', 208, > "[unixODBC][FreeTDS][SQL Server]Invalid object name > 'viewExEmployeeDetails'.", 4612) > ---------------------------- > > The sql query fired is: > ---------------------------- > SELECT * FROM viewExEmployeeDetails WHERE > ProjectTilte='MIS' ORDER BY Name ASC > ---------------------------- > > > Does anyone have a reason/solution to this problem? This is likely a permission problem. Please check your MS SQL Server configuration. For details, see: http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > Can access views through mxODBC? Sure. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 09 2005) >>> 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 maneeshsingh at yahoo.com Wed Feb 9 04:42:31 2005 From: maneeshsingh at yahoo.com (Maneesh Singh) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Error in accessing a view which works well with isql. Message-ID: <20050209124231.79461.qmail@web14206.mail.yahoo.com> Hi Marc, Thanks for your help. There was an incorrect dsn,user & password strings given for the Python-MS SQL Server 2000 connection. I noticed it after you replied and I was reading the code again. It was a copy-paste code which I had used for another system & apparently forgot to change the strings when reusing the code. Sorry for the inconvienence due to my overlooking! Thanks! Bye! Maneesh. > --- "M.-A. Lemburg" wrote: > > > Maneesh Singh wrote: > > > Hi, > > > I need to aceess a view on a MS SQL Server > 2000 > > > database from my Fedora Core 2 machine using > > > freetds+unixODBC+mxODBC (Python 2.3). > > > The SQL query runs fine with isql but gives > the > > > following error with a python script: > > > ---------------------------- > > > mxODBC.ProgrammingError: ('S0002', 208, > > > "[unixODBC][FreeTDS][SQL Server]Invalid object > > name > > > 'viewExEmployeeDetails'.", 4612) > > > ---------------------------- > > > > > > The sql query fired is: > > > ---------------------------- > > > SELECT * FROM viewExEmployeeDetails WHERE > > > ProjectTilte='MIS' ORDER BY Name ASC > > > ---------------------------- > > > > > > > > > Does anyone have a reason/solution to this > > problem? > > > > This is likely a permission problem. Please check > > your > > MS SQL Server configuration. For details, see: > > > > > http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1061.mspx > > > > > Can access views through mxODBC? > > > > Sure. > > > > -- > > Marc-Andre Lemburg > > eGenix.com > > > > Professional Python Services directly from the > > Source (#1, Feb 09 2005) > > >>> 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 ! :::: > > > > > > > __________________________________ > Do you Yahoo!? > All your favorites on one personal page Try My > Yahoo! > http://my.yahoo.com > __________________________________ Do you Yahoo!? All your favorites on one personal page Try My Yahoo! http://my.yahoo.com From Jan.Stiller at hagen-partner.de Mon Feb 14 15:41:33 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 Message-ID: <4210B89D.1050100@hagen-partner.de> Hi First of all, my environment: Windows, MySQL 4.1, mxODBC 2.1.0 (downloaded a few day ago), Zope 2.7.4-0, python 2.3.4 + the Zope DA I need to store Czech or Asian inputs from HTML input fields; is there any step by step introduction to this 'problem' (or a RTFM-answer with pointers to TFM)? My situation: When I use phpMyAdmin with MySQL everything works fine (even with Japanese ;o). Inserting the same characters (for testing +???????????? -- '1'-'0' on the czech keyboad + german umlauts), via python and mxODBC, phpMyAdmin shows: 1, '+????????????????????????' This looks like dumped utf-8 to me. My settings are: con = od.Connect(dsn='myodbc',user='root',password='pwd') con.encoding = 'utf-8' con.stringformat = od.NATIVE_UNICODE_STRINGFORMAT #con.stringformat = od.MIXED_STRINGFORMAT c = con.cursor() c.execute("update test set textfeld = '%s' where id = 1" % ('+????????????',)) c.execute('select id, textfeld from test order by id limit 2') additionally I set: # Set the string encoding used by the Unicode implementation. The # default is 'ascii', but if you're willing to experiment, you can # change this. encoding = "ascii" # Default value set by _PyUnicode_Init() #js, 11.2.2005 encoding = 'utf8' in site.py. I also tried a HTML-Page with a submit to a Zope SQL-Method with the same effect - garbage... Since the docu says, that unicode is fully supported, I hope that this will be possible in Zope too. If I overlooked something in the fine manuals, please send me a pointer. tia Jan From charlie at egenix.com Mon Feb 14 15:52:27 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:34:03 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210B89D.1050100@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> Message-ID: <20050214155227.12859.12@Zeta.1108370443.fake> On 2005-02-14 at 15:41:33 [+0100], Jan Stiller wrote: > I also tried a HTML-Page with a submit to a Zope SQL-Method with the > same effect - garbage... > > > Since the docu says, that unicode is fully supported, I hope that this > will be possible in Zope too. > > > If I overlooked something in the fine manuals, please send me a pointer. Hi Jan, you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't support unicode. It should be possible to use an ExternalMethod with bound parameters instead for data input. Hope this helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 16:37:27 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Mar 31 16:34:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214155227.12859.12@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> Message-ID: <4210C5B7.30900@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 15:41:33 [+0100], Jan Stiller > wrote: > > >>I also tried a HTML-Page with a submit to a Zope SQL-Method with the >>same effect - garbage... >> >> >>Since the docu says, that unicode is fully supported, I hope that this >>will be possible in Zope too. >> >> >>If I overlooked something in the fine manuals, please send me a pointer. >> >> > >Hi Jan, > >you haven't overlooked anything it's just that Zope (actually ZSQL) doesn't >support unicode. It should be possible to use an ExternalMethod with bound >parameters instead for data input. > >Hope this helps > >Charlie > > Hi Charlie asking for help obviously liberated my brain ;o) 1. This SET CHARACTER SET utf8 update test set textfeld = where tid = 1 seems to work... and Zope (or whoever) seems to remember this between different calls (I commented set char... out). Is there any 'official' place to set the character set? 2. Do you have a small example for an external method? (I need some batch processing too) tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/6578bfa3/attachment-0139.htm From charlie at egenix.com Mon Feb 14 16:55:29 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:34:05 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210C5B7.30900@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> Message-ID: <20050214165529.14380.13@Zeta.1108370443.fake> On 2005-02-14 at 16:37:27 [+0100], Jan Stiller wrote: > Hi Charlie > > asking for help obviously liberated my brain ;o) > > 1. > This > > SET CHARACTER SET utf8 > > update test > set textfeld = > where tid = 1 > > seems to work... and Zope (or whoever) seems to remember this between > different calls (I commented set char... out). > > Is there any 'official' place to set the character set? > > > 2. > Do you have a small example for an external method? (I need some batch > processing too) The external method just receives an mxODBCZopeDA connection object and calls its .execute(code, (paras)) method as if it were written in Python. I posted an example on the Zope-DB list last year. ah here it is: 3) Use an external Method. This has the advantage of being much finer grained conrtol than allowing all PythonScripts to do something but done properly is nearly as flexible. Create a file in ~/Extensions say ODBC_SQL.py This is essentially needs only one function: def callSQL(connectionObject, statement): conn = connectionObject.database_connection() return conn.execute(statement) Create an external method say SQL which points to callSQL in ODBC_SQL You can then call this method from any PythonScript and simply pass it the connection and statement you want to execute. In your case the PythonScript needs only to be modified slightly, depending on what you want to. statement = """select [Building ID] from [Buildings] where [Building Name] = ?""", building)[1] columns, results = context.SQL(container.crc_db, statement) Hope that helps Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 17:34:05 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Mar 31 16:34:06 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214165529.14380.13@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> Message-ID: <4210D2FD.90807@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 16:37:27 [+0100], Jan Stiller > wrote: > > >>Hi Charlie >> >>asking for help obviously liberated my brain ;o) >> >>1. >>This >> >>SET CHARACTER SET utf8 >> >>update test >>set textfeld = >>where tid = 1 >> >>seems to work... and Zope (or whoever) seems to remember this between >>different calls (I commented set char... out). >> >>Is there any 'official' place to set the character set? >> >> >>2. >>Do you have a small example for an external method? (I need some batch >>processing too) >> >> > >The external method just receives an mxODBCZopeDA connection object and >calls its .execute(code, (paras)) method as if it were written in Python. I >posted an example on the Zope-DB list last year. > >ah here it is: > >3) Use an external Method. This has the advantage of being much finer >grained >conrtol than allowing all PythonScripts to do something but done properly >is >nearly as flexible. > >Create a file in ~/Extensions say ODBC_SQL.py > >This is essentially needs only one function: > >def callSQL(connectionObject, statement): > conn = connectionObject.database_connection() > return conn.execute(statement) > >Create an external method say SQL which points to callSQL in ODBC_SQL > >You can then call this method from any PythonScript and simply pass it the >connection and statement you want to execute. > >In your case the PythonScript needs only to be modified slightly, depending >on what you want to. > >statement = """select [Building ID] from [Buildings] > where [Building Name] = ?""", building)[1] >columns, results = context.SQL(container.crc_db, statement) > >Hope that helps > >Charlie > > Thanks indeed We have many many ZSQLs and we wouldn't like to rewrite all their callees - your (btw fine) product surely has one single place, where connections are made. Is it possible to make a 'SET CHARACTER SET'-call right after the creation of the connection or do I have to repeat this every time? tia Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/f0b02ae5/attachment-0139.htm From Jan.Stiller at hagen-partner.de Mon Feb 14 17:49:18 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 FIXED(?) In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <4210D68E.3000600@hagen-partner.de> Jan Stiller wrote: > Charlie Clark wrote: > >>On 2005-02-14 at 16:37:27 [+0100], Jan Stiller >> wrote: >> >> >>>Hi Charlie >>> >>>asking for help obviously liberated my brain ;o) >>> >>>1. >>>This >>> >>>SET CHARACTER SET utf8 >>> >>>update test >>>set textfeld = >>>where tid = 1 >>> >>>seems to work... and Zope (or whoever) seems to remember this between >>>different calls (I commented set char... out). >>> >>>Is there any 'official' place to set the character set? >>> >>> >>>2. >>>Do you have a small example for an external method? (I need some batch >>>processing too) >>> >>> >> >>The external method just receives an mxODBCZopeDA connection object and >>calls its .execute(code, (paras)) method as if it were written in Python. I >>posted an example on the Zope-DB list last year. >> >>ah here it is: >> >>3) Use an external Method. This has the advantage of being much finer >>grained >>conrtol than allowing all PythonScripts to do something but done properly >>is >>nearly as flexible. >> >>Create a file in ~/Extensions say ODBC_SQL.py >> >>This is essentially needs only one function: >> >>def callSQL(connectionObject, statement): >> conn = connectionObject.database_connection() >> return conn.execute(statement) >> >>Create an external method say SQL which points to callSQL in ODBC_SQL >> >>You can then call this method from any PythonScript and simply pass it the >>connection and statement you want to execute. >> >>In your case the PythonScript needs only to be modified slightly, depending >>on what you want to. >> >>statement = """select [Building ID] from [Buildings] >> where [Building Name] = ?""", building)[1] >>columns, results = context.SQL(container.crc_db, statement) >> >>Hope that helps >> >>Charlie >> >> > Thanks indeed > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER > SET'-call right after the creation of the connection or do I have to > repeat this every time? > > tia > Jan > >------------------------------------------------------------------------ > > >_______________________________________________________________________ >eGenix.com User Mailing List http://www.egenix.com/ >http://lists.egenix.com/mailman/listinfo/egenix-users > > Maybe I just found the answer ('asking for help obviously...' ;o): DSN=myodbc;UID=root; PWD=pwd; STMT=SET CHARACTER SET utf8 you can add a statement to your connection string and everything seems to work fine... I will test this assumption with our big application. Thanks Charlie ciao Jan p.s. If we buy your product, do we get the opportunity to program some calls like the one mentioned above? -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/76ed0243/attachment-0139.htm From charlie at egenix.com Mon Feb 14 18:22:00 2005 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <4210D2FD.90807@hagen-partner.de> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> Message-ID: <20050214182200.16257.14@Zeta.1108370443.fake> On 2005-02-14 at 17:34:05 [+0100], Jan Stiller wrote: > > We have many many ZSQLs and we wouldn't like to rewrite all their > callees - your (btw fine) product surely has one single place, where > connections are made. Is it possible to make a 'SET CHARACTER SET'-call > right after the creation of the connection or do I have to repeat this > every time? Not currently unfortunately. The best thing for you might be to hack your ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has been sorely neglected for many years in favour of "do everything in ZODB". I have started work on a different approach to ZSQLs which would make support for this kind of thing a lot easier but as ZSQLs currently ignore parameter passing (check the source) and require the DA to create single SQL statements our hands are kind of tied. By the way, have you had any success reading unicode from your database? I remember that I couldn't get this to render in Zope having to read in Latin-1 and convert in a PythonScript. Good luck! Charlie From Jan.Stiller at hagen-partner.de Mon Feb 14 18:37:51 2005 From: Jan.Stiller at hagen-partner.de (Jan Stiller) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] Zope, MySQL, UTF-8 In-Reply-To: <20050214182200.16257.14@Zeta.1108370443.fake> References: <4210B89D.1050100@hagen-partner.de> <20050214155227.12859.12@Zeta.1108370443.fake> <4210C5B7.30900@hagen-partner.de> <20050214165529.14380.13@Zeta.1108370443.fake> <4210D2FD.90807@hagen-partner.de> <20050214182200.16257.14@Zeta.1108370443.fake> Message-ID: <4210E1EF.6030904@hagen-partner.de> Charlie Clark wrote: >On 2005-02-14 at 17:34:05 [+0100], Jan Stiller > wrote: > > >>We have many many ZSQLs and we wouldn't like to rewrite all their >>callees - your (btw fine) product surely has one single place, where >>connections are made. Is it possible to make a 'SET CHARACTER SET'-call >>right after the creation of the connection or do I have to repeat this >>every time? >> >> > >Not currently unfortunately. The best thing for you might be to hack your >ZSQL-Product to allow you to do this. Sorry for this but Zope and RDBMS has >been sorely neglected for many years in favour of "do everything in ZODB". >I have started work on a different approach to ZSQLs which would make >support for this kind of thing a lot easier but as ZSQLs currently ignore >parameter passing (check the source) and require the DA to create single >SQL statements our hands are kind of tied. > >By the way, have you had any success reading unicode from your database? I >remember that I couldn't get this to render in Zope having to read in >Latin-1 and convert in a PythonScript. > >Good luck! > >Charlie > > Hi I'm not sure if you mean this (Unicode ?= UTF8), but: in the HTML-Header and the above mentionened addition to the dsn was all I had to do... Surprisingly you even don't seem to have patch your site.py - hmm hope this helps I have another Question: We might migrate to PostgreSQL or even MSSQL - do you have heard of any Unicode related problems with these db's? (I don't think that MySQL's STMT is standard) ciao Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20050214/922bcabc/attachment-0139.htm From tmorgan at fcsok.org Wed Feb 16 10:21:10 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: I have been using the mxODBC Zope DA for some time now and it's been great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of a problem for all our applications currently in use because we use BIGINT in several of our tables and the floats being returned are unexpected. I opened up a command prompt and connected with mxODBC and got the same result (so it's not just the DA). We use: * MS SQL Server 2000 * Windows 2000 Server * Zope 2.7 * Python 2.3 I have downloaded the latest version of the Database Adapter and still have the same problem. Any help would be greatly appreciated. Thanks. ~~~ Tim Morgan, I.T. Spec. * Family & Children's Services * (918) 560-1131 * tmorgan@fcsok.org CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org. From mal at egenix.com Wed Feb 16 17:35:56 2005 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float In-Reply-To: References: Message-ID: <4213766C.2000302@egenix.com> Tim Morgan wrote: > I have been using the mxODBC Zope DA for some time now and it's been > great. Our agency recently upgraded Zope to version 2.7 with Python 2.3, > and the Database Adapter now returns BIGINTs as FLOATs. This is a bit of > a problem for all our applications currently in use because we use > BIGINT in several of our tables and the floats being returned are > unexpected. We didn't change anything in this area, so this must be related to either the ODBC driver or the database. Note that BIGINTs are returned as Python long objects by mxODBC, if the database tells mxODBC that the columns are of this type. Only DECIMAL, FLOAT etc. are returned as floats. It is possible that Zope 2.7 introduced some change related to Python longs, but I'm not aware of anything in this area. > I opened up a command prompt and connected with mxODBC and got the same > result (so it's not just the DA). > > We use: > * MS SQL Server 2000 > * Windows 2000 Server > * Zope 2.7 > * Python 2.3 > > I have downloaded the latest version of the Database Adapter and still > have the same problem. > > Any help would be greatly appreciated. Thanks. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Feb 16 2005) >>> 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 tmorgan at fcsok.org Wed Feb 16 11:26:38 2005 From: tmorgan at fcsok.org (Tim Morgan) Date: Fri Mar 31 16:34:07 2006 Subject: [egenix-users] mxODBC bigint fetched as float Message-ID: You were right. I reinstalled the database driver and all is well now. Thanks for your quick response and pointing me in the right direction. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Wednesday, February 16, 2005 10:36 AM > To: Tim Morgan > Cc: egenix-users@lists.egenix.com > Subject: Re: [egenix-users] mxODBC bigint fetched as float > > Tim Morgan wrote: > > I have been using the mxODBC Zope DA for some time now and > it's been > > great. Our agency recently upgraded Zope to version 2.7 with Python > > 2.3, and the Database Adapter now returns BIGINTs as > FLOATs. This is a > > bit of a problem for all our applications currently in use > because we > > use BIGINT in several of our tables and the floats being > returned are > > unexpected. > > We didn't change anything in this area, so this must be > related to either the ODBC driver or the database. > > Note that BIGINTs are returned as Python long objects by > mxODBC, if the database tells mxODBC that the columns are of > this type. > Only DECIMAL, FLOAT etc. are returned as floats. > > It is possible that Zope 2.7 introduced some change related > to Python longs, but I'm not aware of anything in this area. > > > I opened up a command prompt and connected with mxODBC and got the > > same result (so it's not just the DA). > > > > We use: > > * MS SQL Server 2000 > > * Windows 2000 Server > > * Zope 2.7 > > * Python 2.3 > > > > I have downloaded the latest version of the Database > Adapter and still > > have the same problem. > > > > Any help would be greatly appreciated. Thanks. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, > Feb 16 2005) > >>> 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 ! :::: > > CONFIDENTIALITY NOTICE: This email, including any attachments, is intended only for the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. If the reader of this message is not the intended recipient, you are hereby informed that any review, use, disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please contact the sender by reply email and delete all forms of the original message from your system. Thank you. This e-mail and all other electronic (including voice) communications from the sender's agency are for informational purposes only. No such communication is intended by the sender to constitute either an electronic record or an electronic signature, or to constitute any agreement by the sender to conduct a transaction by electronic means. Any such intention or agreement is hereby expressly disclaimed unless otherwise specifically indicated. To learn more about our agency, please visit our website at http://www.fcsok.org.